<?php

namespace app\enum;

use core\enum\EnumInterface;

/**
 * 用户表字段模型
 */
enum UserFieldType: string implements EnumInterface
{
    case TYPE_STRING  = 'string';
    case TYPE_TEXT    = 'text';
    case TYPE_INTEGER = 'integer';

    public function title(): string
    {
        return match ($this) {
            UserFieldType::TYPE_STRING  => '字符串',
            UserFieldType::TYPE_TEXT    => '文本',
            UserFieldType::TYPE_INTEGER => '数字',
        };
    }

    public function color(): string
    {
        return match ($this) {
            UserFieldType::TYPE_STRING  => '#0a6aff',
            UserFieldType::TYPE_TEXT    => '#0a6aff',
            UserFieldType::TYPE_INTEGER => '#0a6aff',
        };
    }
}
